package com.hyz.service.impl;

import com.hyz.mapper.AuthenticationMapper;
import com.hyz.pojo.Authentication;
import com.hyz.service.AuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuthenticationServiceImpl implements AuthenticationService {
    @Autowired
    private AuthenticationMapper mapper;

    /**
     * 登录验证
     * @param username
     * @param password
     * @param rightsId
     * @return
     */
    @Override
    public Boolean getLoginResult(String username, String password, Long rightsId) {
        List<Authentication> authenticationList = mapper.getAuthentication(username,password,rightsId);
        return !authenticationList.isEmpty();
        //等价于return authenticationList.isEmpty() ?  false:  true;
    }
}
